var adminTableWithConsole;

function adminReport(text) { 
    adminTableWithConsole.log(text);
}

function init_admin_table_reporting(onRowClick) {
    adminTableWithConsole = new TableWithConsole('#table_admin', '#console');
    adminTableWithConsole.initTable([
        {"sTitle": "Libell&eacute; du smartlock"},
        {"sTitle": "Etat"},
        {"sTitle": "N&deg; d'abonnement"},
    ], onRowClick);
}

function load_admin_table_reporting() {
    var t = [];
    for (var i = 0; i < this.length; i++) {
        var tmp = [];
        var elt = this[i];
        tmp.push(elt.reference);
        tmp.push((elt.actif == 1 ? (elt.abonnement ? 'En location' : 'Disponible') : 'Inactif'));
        tmp.push(elt.abonnement);
        tmp.push(elt.lat);
        tmp.push(elt.lng);
        t.push(tmp);
    }
    adminTableWithConsole.loadTable(t);
}




